<?php

namespace app\admin\model\train;

use app\admin\model\User;
use think\Model;
use traits\model\SoftDelete;

class enroll extends Model
{
    use SoftDelete;
    // 表名
    protected $name = 'train_enroll';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    public function art()
    {
        return $this->hasOne(Article::class, 'id', 'article_id', [], 'LEFT');
    }
    public function user()
    {
        return $this->hasOne(User::class, 'id', 'uid', [], 'LEFT');
    }
}
